#ifndef CTRL_CONTROL_COMMAND_HPP
#define CTRL_CONTROL_COMMAND_HPP

#include "Ctrl/CtrlConfig.hpp"

namespace Ctrl
{

class ControlCenter;

/// @ingroup Ctrl
/// @brief It provides the interface that should be implemented by all the commands that change the model.
///
/// The control commands provide the logic that unifies the model operations, the storage operations and the controlling 
///	of the views. Basically, such a command implementation performs the changes to the model, announces those changes to 
///	the storage layer and uses the controllers' signals to announce the subscribed views about the changes it performed. 
///	This command provides two execution methods, one for undo and one for redo.
class CTRL_API ControlCommand
{
public:
	/// @brief It initializes the command.
	/// @param ctrlCenter the control center this command should be bound to. The control center will be used to signal 
	///		various events that might occur while changing the model.
	ControlCommand( ControlCenter& ctrlCenter);

	/// @brief Dummy destructor.
	virtual ~ControlCommand();

	/// @brief Subclasses should implement the execution logic in this method.
	virtual void execute() = 0;

	/// @brief Subclasses should implement the logic for reverting the execution of the command.
	virtual void undo() = 0;

protected:
	ControlCenter& rCtrlCenter_;
};
	
} // namespace Ctrl

#endif // CTRL_CONTROL_COMMAND_HPP
